#include <iostream>
#include <thread>
using namespace std;

int sum =0;
int add(int a,int b){
    sum += a+b;
    return sum;
}

int main(){
    int a= 10;
    int b = 20;
    thread t1(add,a,b);
    thread t2(add,b,a);
    t1.join();
    t2.join();
    cout<<"sum = "<<sum<<endl;
    return 0;
}